﻿using System;


namespace EasyWindowsServiceManager.Dialogs
{
    public partial class SetComputerToConnect : EasyWindowsServiceManager.Dialogs.DialogBase
    {
        public SetComputerToConnect()
        {
            InitializeComponent();
        }

        private void SetComputerToConnect_Load(object sender, EventArgs e)
        {
            this.localizeControls();
            string thisComputerName = System.Environment.MachineName;
            this.txtComputerSelected.Text = thisComputerName;            
        }

        protected override void localizeControls()
        {
            base.localizeControls();
            this.Text = Localization.StringResources.SetComputerToConnect_text;
            this.lblSelectComputer.Text = Localization.StringResources.SetComputerToConnect_lblSelectComputer_text;
            
        }

        private void cmdSelectComputer_Click(object sender, EventArgs e)
        {
            string selectedComputer = String.Empty;
            selectedComputer = Dialogs.NetBrowser.ComputerBrowser.GetComputerName(Localization.StringResources.SetComputerToConnect_dialogTitle);
            this.txtComputerSelected.Text = selectedComputer;
        }

        private void SetComputerToConnect_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            this.returnValue = this.txtComputerSelected.Text;
        }



    }
}
